package com.zzw.mvvm.pages.demo;


import android.util.Log;
import android.view.View;

import com.zzw.mvvm.R;
import com.zzw.mvvm.base.BaseActivity;
import com.zzw.mvvm.viewmodels.demo.DataBaseDemoViewModel;

import androidx.lifecycle.Observer;

public class DataBaseDemoActivity extends BaseActivity<DataBaseDemoViewModel> {


    @Override
    public int getLayoutId() {
        return R.layout.activity_data_base_demo;
    }

    @Override
    public void bindViewModel() {
        viewModel = createViewModel(DataBaseDemoViewModel.class);
        viewModel.getName().observe(this, new Observer<String>() {
            @Override
            public void onChanged(String s) {
                Log.i("zzw","s change==="+s);
            }
        });
    }
    public void click(View view){
        Log.i("zzw","clicl==");
        viewModel.getDataMsg();
    }
    public void add(View view){
        viewModel.addDataMsg();
    }
}
